import { UserInfo } from "@/service/type";
import request from "@/utils/request";
import { IArcheryOptions, IQueryInfoOptions, IStarOptions } from "./types";

/** 查询用户信息 */
export function fetchCustomerInfo(options: IQueryInfoOptions) {
  return request.get<UserInfo>(`/cupid/customer/des-customer-info`, options)
}

/** 收藏 */
export function fetchStarUser(options: IStarOptions) {
  return request.post('/cupid/customer-collect', options)
}

/** 取消收藏 */
export function fetchUnStarUser(id: string) {
  return request.delete(`/cupid/customer-collect/${id}`)
}

/** 判断用户是否被收藏 */
export function fetchIsStar(id: string) {
  return request.get(`/cupid/customer-collect/${id}`)
}


/** 射箭 */
export function fetchArchery(options: IArcheryOptions) {
  return request.post('/cupid/customer-arrow-record/arrow', options, {
    suffix: true
  })
}

/** 判断是否有权查看对方联系方式 */
export function fetchContact(options: { customerId: string }) {
  return request.get<boolean>('/cupid/customer/check-contact-permission', options)
}
